package com.clock.controller.stage;


import com.clock.common.domain.R;
import com.clock.domain.dto.CommentDTO;
import com.clock.domain.dto.InsertDiscussPostDTO;
import com.clock.service.CommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = {"评论"})
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Resource
    CommentService commentService;

    @PostMapping("/newComment")
    @ApiOperation(value = "发布新评论", notes = "评论对象可为用户、帖子、评论")
    public R insertNewComment(@RequestBody CommentDTO commentDTO) throws Exception {

        return commentService.addNewComment(commentDTO);
    }

}
